﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HomeDefault.Master" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="NSX07._default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

  <div class="center_title_bar">New Products</div>
    <asp:DataList ID="NewProductDataList" runat="server" DataKeyField="id" 
        DataSourceID="NewProductDataSource" RepeatColumns="3" 
        RepeatDirection="Horizontal" >
        <ItemTemplate>
        <div class="prod_box">
            <div class="center_prod_box">
                <div class="product_title">
                    <a href="productdetails.aspx?id=<%#Eval("id") %>"> <asp:Label ID="Label1" runat="server" Text='<%# Eval("name") %>' /></a>
                </div>
                <div class="product_img">
                    <a href="productdetails.aspx?id=<%#Eval("id") %>"><img border="0"  alt="" src='<%# Eval("imageUrl") %>' width="100" height="150"></a>
                </div>
                <div class="prod_price">
                    price: $<span class="price"><%# Eval("price") %></span>
                </div> 
            </div>
            <div class="prod_details_tab">
                <a class="prod_buy" href="">Add to Cart</a>
                <a class="prod_details" href="productdetails.aspx?id=<%#Eval("id") %>"">Details</a>
            </div>
        </div>
        </ItemTemplate>
    </asp:DataList>
    <asp:ObjectDataSource ID="NewProductDataSource" runat="server" 
        DeleteMethod="Delete" InsertMethod="Insert" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetNewProducts" 
        TypeName="NSX07.App_Code.MyDalLayerTableAdapters.ProductTableAdapter" 
    UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="imageUrl" Type="String" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="idCategory" Type="Int32" />
            <asp:Parameter Name="stock" Type="Int32" />
            <asp:Parameter Name="price" Type="Double" />
            <asp:Parameter Name="Author" Type="String" />
            <asp:Parameter Name="publishDate" Type="DateTime" />
            <asp:Parameter Name="Original_id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="imageUrl" Type="String" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="idCategory" Type="Int32" />
            <asp:Parameter Name="stock" Type="Int32" />
            <asp:Parameter Name="price" Type="Double" />
            <asp:Parameter Name="Author" Type="String" />
            <asp:Parameter Name="publishDate" Type="DateTime" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>
